package com.toby.dao;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * @desc: 产品dao
 * @author: jonathan.zhang
 * @date: 2019/10/8 22:23
 */
@Repository
public class ProductDao {
    @Autowired
    private JdbcTemplate jdbcTemplate;

    public int updateProduct(Integer productId) {
        String sql = "update t_product set store = store - 1 where id = ?";
        return jdbcTemplate.update(sql,productId);
    }
}
